<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2016/9/8
  Time: 15:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <jsp:include page="../../head.jsp"/>
    <title>Title</title>
    <script type="text/javascript">
        var formSetting = {
            title: "查询信息",
            module: 'query',
            columns: [
                {
                    index: "TITLE",
                    name: "title",
                    label: "标题"
                }, {
                    index: "CREATE_TIME",
                    name: "create_time",
                    label: "发送时间起",
                    type: "date",
                    op: "ge"
                }, {
                    index: "CREATE_TIME",
                    name: "create_time",
                    label: "发送时间止",
                    type: "date",
                    op: "le"
                }],
            buttons: {
                custom: []
            },
            grid: {
                id: "msgBoxListDataGrid",
                title: "查询结果",
                url: "findMsgBoxList",
                colModel: [{
                    index: "ID",
                    name: "id",
                    hidden: true
                }, {
                    name: "title",
                    label: "标题"
                }, {
                    name: "createTime",
                    label: "时间"
                }, {
                    name: "isRead",
                    label: "是否已读",
                    formatter: function (cellvalue, options, rowObject) {
                        if (cellvalue && cellvalue == 1) {
                            return "已读";
                        } else {
                            return "未读";
                        }
                    }
                }, {
                    label: "操作",
                    sortable: false,
                    formatter: function (cellvalue, options, rowObject) {
                        var result = "<a href=\"./view?id=" + rowObject.id
                                     + "\" >查看</a>&nbsp;&nbsp;";
                        return result;
                    }
                }],
                sortname: "createTime",
                sortorder: "desc",
                ondblClickRow: function (rowid, iRow, iCol, e) {
                    if (rowid) {
                        var rowData = $("#msgBoxListDataGrid").jqGrid("getRowData", rowid);
                        window.location.href = "./view?id=" + rowData.id;
                    }
                }
            }
        };
        $(document).ready(function () {
            $("#msgBoxListDataTable").mrdForm(formSetting);
        });
    </script>
</head>
<body>
<div id="msgBoxListDataTable"></div>
</body>
</html>
